#include "Fibonacci.h"

int Fibonacci(lua_State *L)
{
    int n = lua_tonumber(L,-1);
    std::vector<int> dp(n+1);
    dp[0] = 0;
    dp[1] = 1;
    for (int i = 2; i <= n; ++i)
    {
        dp[i] = dp[i - 1] + dp[i - 2];
    }
    lua_pushnumber(L,dp[n]);
    return 1;
}
BOOST_DLL_ALIAS(Fibonacci,fibFunc);